Skip to content

compiler: Enable blocking-before-CIRE#2948

Open
FabioLuporini wants to merge 16 commits into
mainfrom
smarter-tuner-3
Open

compiler: Enable blocking-before-CIRE#2948
FabioLuporini wants to merge 16 commits into
mainfrom
smarter-tuner-3

Conversation

@FabioLuporini

Copy link
Copy Markdown
Contributor

This is key for features in PRO

In doing so, several utility functions are added, which might come in handy in the future as well

Some clean up also, which is never a bad thing

else:
self.umt_reduce = UnboundTuple(*par_tile.default, 1)

def next(self, prefix, d, clusters):

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

significant reduction in complexity

Comment thread tests/test_dle.py
assert iters[0].step == par_tile[1]
assert iters[1].step == par_tile[0]

def test_custom_rule0(self):

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unused feature, dropped; so dropping the tests too

@codecov

codecov Bot commented Jun 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.56757% with 46 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.61%. Comparing base (c01281c) to head (53f0bd2).

Files with missing lines Patch % Lines
devito/passes/clusters/aliases.py 81.53% 22 Missing and 2 partials ⚠️
devito/passes/clusters/blocking.py 90.19% 3 Missing and 2 partials ⚠️
devito/ir/support/guards.py 73.33% 3 Missing and 1 partial ⚠️
devito/types/parallel.py 66.66% 4 Missing ⚠️
devito/ir/clusters/cluster.py 86.36% 2 Missing and 1 partial ⚠️
devito/passes/iet/engine.py 0.00% 3 Missing ⚠️
devito/core/operator.py 50.00% 1 Missing and 1 partial ⚠️
devito/arch/compiler.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             main    #2948    +/-   ##
========================================
  Coverage   83.60%   83.61%            
========================================
  Files         250      250            
  Lines       52908    53053   +145     
  Branches     4564     4574    +10     
========================================
+ Hits        44235    44358   +123     
- Misses       7895     7914    +19     
- Partials      778      781     +3     
Flag Coverage Δ
pytest-gpu-aomp-amdgpuX 68.78% <51.19%> (-0.10%) ⬇️
pytest-gpu-gcc- 78.41% <86.48%> (+0.02%) ⬆️
pytest-gpu-icx- 78.34% <86.48%> (+0.01%) ⬆️
pytest-gpu-nvc-nvidiaX 69.44% <67.36%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

"""Return the DataSpace of this ClusterGroup."""
return DataSpace.union(*[i.dspace.reset() for i in self])

@property

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cached?

Comment thread devito/core/gpu.py

# Overrides the default values in the main Operator class
BLOCK_LEVELS = 0
CIRE_BLOCK_TEMPS = False

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it intended to be a default or enforced?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enforced or things would break

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then it needs to be moved to line 81 below and prevent it from being a user option (i.e no oo.pop)

Comment thread devito/ir/clusters/cluster.py Outdated
if not mapper:
return self

if self.halo_scheme:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can probably be relaxed to self.halo_scheme.distributed_aindices & mapper.keys()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a false problem anyway. The halo_scheme attribute only gets populated at stree-construction time, so none of the compiler passes across the entire Cluster layer will ever have to worry about this

Comment thread devito/ir/support/basic.py Outdated
# Handle ComponentAccesses
subs = {i: Symbol(f'dummy{n}') for n, i in enumerate(compaccs)}
exprs1 = uxreplace(exprs, subs)
terms1 = retrieve_terminals(exprs1, **kwargs)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would likely be "cheaper" to have an ignore=compaccs in retrieve_terminals

@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@FabioLuporini FabioLuporini force-pushed the smarter-tuner-3 branch 3 times, most recently from 5490ce6 to 757726c Compare June 23, 2026 13:49
def promote(self, subs):
m = self
for d, v in subs.items():
guards = {self.get(i) for i in d._defines} - {true}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-{true, None} ?

interval = imapper[d]
except KeyError:
if i.dim in a.free_symbols:
if d in a.free_symbols:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a.has(d) is likely slightly faster

# Given the iteration `interval`, lower distances to indices
for distance, indices in zip(a.distances, indicess, strict=True):
v = distance[interval.dim] or 0
v = distance[i.dim] or 0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

distance[d]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants